<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Http\Requests\UserContext;
use App\Http\Services\DragService;
use App\Http\Traits\ResponseJson;

class DragController extends Controller
{
    use ResponseJson;

    protected $dragService;

    public function __construct(DragService $dragService)
    {
        $this->dragService = $dragService;
    }

    public function save(UserContext $userContext)
    {
        $data = $this->dragService->save($userContext);
        return $this->returnJson($data);
    }

    public function lists(UserContext $userContext)
    {
        $data = $this->dragService->lists($userContext);
        return $this->returnJson($data);
    }

    public function myAttempt(UserContext $userContext)
    {
        $data = $this->dragService->myAttempt($userContext);
        return $this->returnJson($data);
    }

    public function detail(UserContext $userContext)
    {
        $data = $this->dragService->detail($userContext);
        return $this->returnJson($data);
    }

    public function endDrag()
    {
        $data = $this->dragService->endDrag();
        return $this->returnJson($data);
    }

    public function shopDragList()
    {
        $data = $this->dragService->shopDragList();
        return $this->returnJson($data);
    }

    public function removeDrag(UserContext $userContext)
    {
        $data = $this->dragService->removeDrag($userContext);
        return $this->returnJson($data);
    }

    public function checkHadPay(UserContext $userContext)
    {
        $data = $this->dragService->checkHadPay($userContext);
        return $this->returnJson($data);
    }

    public function exportDragon()
    {
        $data = $this->dragService->exportDragon();
        return $this->returnJson($data);
    }
}
